//
//  LJP_PlayerDownView.m
//  God_is_a_Girl
//
//  Created by 李继鹏 on 15/10/6.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LJP_PlayerDownView.h"
#import "LJP_PlayerModel.h"
#import <UIImageView+WebCache.h>
@implementation LJP_PlayerDownView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.picture = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 60, 60)];
        self.picture.layer.cornerRadius = 30;
        self.picture.layer.masksToBounds = YES;
        self.picture.layer.borderColor = [UIColor clearColor].CGColor;
        self.picture.layer.borderWidth = 2;
        self.title = [[UILabel alloc] initWithFrame:CGRectMake(110, 20, [UIScreen mainScreen].bounds.size.width - 100, 20)];
        self.liker = [[UILabel alloc] initWithFrame:CGRectMake(110, 50, [UIScreen mainScreen].bounds.size.width - 100, 15)];
        self.ptitle = [[UILabel alloc] initWithFrame:CGRectMake(110, 70, [UIScreen mainScreen].bounds.size.width - 100, 20)];
        self.liker.font = [UIFont systemFontOfSize:13];
        self.liker.textColor = [UIColor colorWithWhite:0.669 alpha:1.000];
        self.ptitle.font = [UIFont systemFontOfSize:15];
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 95, 50, 25)];
        label.text = @"简介:";
        self.info = [[UILabel alloc] initWithFrame:CGRectMake(10, 120, [UIScreen mainScreen].bounds.size.width - 20, frame.size.height - 130)];
        self.info.font = [UIFont systemFontOfSize:15];
        self.info.numberOfLines = 0;
        [self addSubview:self.ptitle];
        [self addSubview:self.picture];
        [self addSubview:self.title];
        [self addSubview:self.liker];
        [self addSubview:self.info];
        [self addSubview:label];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
- (void)setModel:(LJP_PlayerModel *)model
{
    if (model != _model) {
        _model = model;
    }
    [self.picture sd_setImageWithURL:[NSURL URLWithString:_model.smallLogo] placeholderImage:[UIImage imageNamed:@"search"]];
    self.title.text = _model.nickname;
    self.liker.text = [NSString stringWithFormat:@"声音 %@   粉丝 %@", _model.tracks, _model.followers];
    self.ptitle.text = _model.ptitle;
    self.info.text = _model.intro;
    
}


@end
